﻿Option Strict On
Option Explicit On

Namespace Blog

    <CLSCompliant(True)> _
    Public Class PostCategoryUtils

        Public Shared Function GetPostCategoryById(ByVal intPostCategoryId As Integer) As PostCategory

            Dim objPostCategory As BlogSpark.Blog.PostCategory
            Dim dt As DataTable = BlogSpark.DataProvider.SPs.GetPostCategoryByPostCategoryId(BlogSpark.DataProvider.Data.ConnectionType, intPostCategoryId).Tables(0)

            If dt.Rows.Count > 0 Then
                objPostCategory = New BlogSpark.Blog.PostCategory
                objPostCategory.Fill(dt.Rows(0))
                Return objPostCategory
            Else
                Return Nothing
            End If

        End Function

    End Class

End Namespace

